// 引入koa-router
const Router = require('koa-router')
const {addVip, getVip,searchVip,deleteVip,updatevip,getTodayBorn,getTodayExpires,getTodayAddVip,getThirtyNotConsum,
    getVipRank,addVipRank,updateVipRank,delVipRank,searchVipRank,updateVipScore} = require('../../controller/vip.controller')
// 创建实例
// prefix在路由地址前缀加上默认地址
const router = new Router({ prefix:'/api/vip' })
// 增加会员
router.post('/addvip',addVip)
// 获取会员列表
router.get('/getvip',getVip)
// 搜索会员
router.post('/searchvip',searchVip)
// 会员禁用
router.post('/deletevip',deleteVip)
// 修改会员
router.post('/updatevip',updatevip)
// 今日过生
router.get('/gettodayborn',getTodayBorn)
// 今日到期
router.get('/gettodayexpires',getTodayExpires)
// 今日新增会员
router.get('/gettodayaddvip',getTodayAddVip)
// 本月从未消费过
router.get('/getthirtynotconsum',getThirtyNotConsum)
// 获取会员等级
router.get('/getviprank',getVipRank)
// 添加会员等级
router.post('/addviprank',addVipRank)
// 修改会员等级
router.post('/updateviprank',updateVipRank)
// 删除会员等级
router.post('/delviprank',delVipRank)
// 搜搜会员等级
router.post('/searchviprank',searchVipRank)
// 会员积分变动
router.post('/updatevipscore',updateVipScore)
module.exports = router